<div id="tree_list">
    <div class="modal-header">
        <span class="modal-title" id="modal_white_title"><i class="fas fa-info-circle mr-1"></i>{:lang('v_select')} {:lang('v_sort')}</span>
        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span></button>
    </div>
    <!--内容 开始-->
    <div class="modal-body">
        <div class="w-100 mb-3">
            <form name="form_checksearch" id="form_checksearch">
                <input type="hidden" name="lang" value="{$lang}">
                <input type="hidden" name="tabledir" value="{:input('tabledir')}">
                <div class="input-group">
                    <input name="keyword" id="keyword" placeholder="{:lang('v_quickfind')}" type="text" class="form-control">
                    <span class="input-group-append">
                        <button type="button" class="btn btn-success" onclick="javascript:tree_search('{:url('/sort/index',['lang'=>$lang,'from'=>'sort','tabledir'=>$tabledir])}');"><i class="fas fa-search mr-1"></i>{:lang('v_search')}</button>
                    </span>
                </div>
            </form>
        </div>
        <table class="table table-striped table-bordered table-hover">
            <tr>
                <td>ID</td>
                <td>{:lang('v_title')}</td>
                <td>{:lang('v_do')}</td>
            </tr>
            <form name="form_check" id="form_check">
                {volist name="list" id="rs"}
                    {php}$id = $rs['id']; $haveChild = 'no';{/php}
                    <tr id="tr_{$rs.id}">
                        <td>
                            <label>
                                <span class="d-invisible"> {$rs.id}</span>
                            </label>
                        </td>
                        <td id="td_{$rs.id}">
                            {tag:list name="childRs" table="sort" where="parentid=$id" limit="1" order="id desc"}
                                {php}$haveChild = 'yes';{/php}
                            {/tag:list}
                            {if $haveChild eq 'yes'}
                                <a onclick="javascript:display_child({$rs.id},'{$rs.title}','sort');" href="javascript:void(0);">{$rs.title}<i class="fa fa-plus-square fa-lg ml-2"></i></a>
                            {else /}
                                {$rs.title}
                            {/if}
                        </td>
                        <td>
                            {if input('sortid') neq $rs.id}
                                {if input('parentid') eq $rs.id}
                                    <a href="javascript:void(0);" onclick="javascript:check_close({$rs.id},'{$rs.title}');" class="btn btn-success"><i class="fa fa-check-circle mr-2"></i>{:lang('v_select')}</a>
                                {else /}
                                    <a href="javascript:void(0);" onclick="javascript:check_close({$rs.id},'{$rs.title}');" class="btn btn-default">{:lang('v_select')}</a>
                                {/if}
                            {else}
                                {:lang('v_can_not')} {:lang('v_select')}
                            {/if}
                        </td>
                    </tr>
                {/volist}
                <tr>
                    <td colspan="3">
                        <div class="row">
                            <div class="col-md-12 mt-2">
                                <div class="float-left mr-4">{$list->render()|raw}</div><div class="float-left mt-2">{:lang('v_total')} {$lastPage} {:lang('v_page')} {$total} {:lang('v_records')}</div>
                            </div>
                        </div>
                    </td>
                </tr>
            </form>
        </table>
    </div>
    <!--内容 结束-->
    {include file="public/js_display_child_sort_viewlist" /}
</div>